﻿using KaytechSoftware.Cms.Entities;
using KaytechSoftware.Cms.Services.Interfaces;
using KaytechSoftware.Cms.Services.Interfaces.Entity;

namespace KaytechSoftware.Cms.Services.Dto
{
    public class NewsDto : IDto
    {
        public long Id { get; set; }
        public string Title { get; set; }
        public string Body { get; set; }
        public long PageId { get; set; }
        public string PageTitle { get; set; }
        public long Order { get; set; }

        public NewsDto(News news)
        {
            Id = news.Id;
            Title = news.Title;
            Body = news.Body;
            Order = news.Order;
            PageId = news.PageId;
            if (news.Page != null)
                PageTitle = news.Page.Title;
        }

        public NewsDto()
        {
            
        }
    }
}
